#include <iostream>

/*
int a = 2;

void f1(){
    int a = 0;
    printf("%d\n",a);//局部优先
    printf("%d\n",::a);//::域作用限定符(前面空格或无表示全局域)
}

int main() {
    f1();
    //std::cout << "Hello, World!" << std::endl;
    return 0;
}
*/

/*
#include "List.h"
#include "Queue.h"

int main(){
    struct Queue::Node node1;
    struct List::Node node2;

    Queue::min++;
    List::min++;
    return 0;
}
*/

/*
#include "List.h"
#include "Queue.h"

int main(){
    struct Lu::List::Node node1;
    struct Lu::Queue::Node node2;
    return 0;
}
*/

//小的程序，日常练习，不太会出现冲突：全局展开
/*
#include "Queue.h"
using namespace Lu;

int main(){
    struct Queue q;
    QueueInit(&q);
    QueuePush(&q,1);
    std::cout << "12345";
    return 0;
}
*/

/*
using namespace std;

int main(){
    cout << 111;
    return 0;
}
*/

//实际开发的项目工程：指定命名空间访问或将常用部分展开

/*
using std::cout;
using std::endl;

int main(){
    cout << 1111 << endl;
    int i = 0;
    std::cin >> i;
    cout << i << endl;
    return 0;
}
*/

using namespace std;

/*
int main(){
    cout<<"hello world"<<endl;
    cout<<"hello world"<<'\n';
    int n = 0;
    cin >> n;
    double *a = (double *) malloc(sizeof(double)*n);
    for (int i = 0; i < n; ++i) {
        cin>>a[i];
    }
    for (int i = 0; i < n; ++i) {
        //cout<<a[i]<<" ";
        printf("%.2f ",a[i]);//格式输入时可考虑用C部分
    }
    return 0;
}
*/

/*
void Func1(int a = 3){
    cout << a << endl;
}

void Func2(int a = 1, int b = 2, int c = 3){
    cout << "a = " << a << endl;
    cout << "b = " << b << endl;
    cout << "c = " << c << endl;
}
//使用缺省值，必须从左至右连续使用
int main(){
    Func1();
    Func1(6);
    Func2();
    Func2(22);
    Func2(22,33);
    Func2(22,33,44);
    return 0;
}
*/

struct Stack{
    int *a;
    int top;
    int capacity;
};

void StackInit(struct Stack* ps,int defaultCapacity = 4){
    ps->a = (int *) malloc(sizeof(int)*defaultCapacity);
    ps->top = 0;
    ps->capacity = defaultCapacity;
}

int main(){
    Stack st1;
    StackInit(&st1);//不知道多少个数据，默认初始化4
    Stack st2;
    StackInit(&st2,100);//最多存100个数据
}